<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jstl/fmt_rt" prefix="fmt"%>
<%@ taglib uri="http://www.springframework.org/tags" prefix="spring"%>
<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>
<spring:message  code="pim"/> - <spring:message  code="homepage.project"/>&nbsp;
<c:out value="${bean.project.name}"></c:out> - <spring:message  code="title.project.workspace.tab.documents"/> - <c:out value="${bean.resource.title}"></c:out>     
</title>	
<link href="<%= request.getContextPath() %>/css/custom.css" rel="stylesheet" type="text/css" />
<link href="<%= request.getContextPath() %>/css/style.css" rel="stylesheet" type="text/css" />
<link href="<%= request.getContextPath() %>/css/v.css" rel="stylesheet" type="text/css" />
<link href="<%= request.getContextPath() %>/css/document.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="<%=request.getContextPath()%>/js/jquery-1.6.2.js"></script>
<%@include file="script/pim-util.jsp" %>
</head>
<body>
<c:if test="${bean.isSigned == true}">
<div id="all">
	<div id="wrapper">
		<div id="mainheader">
			<jsp:include page="include/common/headerSignedIn.jsp" />
		</div> 
		<div id="content-wrapper">
			<div id="top-menu">
			    <jsp:include page="include/common/topMenuHome.jsp" />
			</div>
			<c:choose>
				 <c:when test="${bean.isAdmin == true }">
				  	<c:set value="members.htm?pnum=${bean.project.number}&tab=listMembers" var="url"/> 
				 </c:when>
				 <c:otherwise>
				    <c:set value="tasks.htm?pnum=${bean.project.number}" var="url"/> 
				 </c:otherwise>
			</c:choose>			
			<div style="float: right;">
				<a href='<c:out value="${url}" />' style="padding-right: 10px;color: blue;text-decoration:none;"> 
					[<spring:message code="back.to.project.homepage" />]</a>
			</div>						
			<div class="tabs-content v-row">			  
		        <div style="padding: 10px;">				   			   
				   <h2>${bean.resource.title}</h2>					 
				   <p>
				      <span>${bean.resourceCategory.name}</span>
				      <br/>
				      <em style="color: #888888;"><fmt:formatDate pattern="yyyy-MM-dd hh:mm" value="${bean.resource.lastUpdated}"/></em>
				    </p>
				   <div class="wiki">
				     <p><c:out value="${bean.resource.description}" escapeXml="false"></c:out></p>					  			         
	               </div> 
	               <h3>File:</h3>
                   <div class="attachments">	
		            <p>
		               <a style="text-decoration: none;" class="icon icon-attachment" href="${bean.fileUrl}">${bean.resource.orignalName}</a>	       
				       <span class="size">(<fmt:formatNumber value="${bean.resource.size}" maxFractionDigits="1"/> KB)</span>
				       <span class="author">${bean.resource.author}, <fmt:formatDate pattern="yyyy-MM-dd  hh:ss" value="${bean.resource.lastUpdated}" /></span>  
		            </p>
                   </div>	                                
                </div>    				        		        			                 
			</div>
		</div>
		<div class="footer">
			<jsp:include page="include/common/footer.jsp" />
		</div>
    </div>
</div>
</c:if>
</body>
</html>